﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace AzureToolkit.Engine {
    public class JobSchedulingProcessFluent {

        private JobSchedulingProcess process;

        internal JobSchedulingProcessFluent(JobSchedulingProcess process) {
            this.process = process;
        }

        public JobSchedulingProcessFluent ScheduleJob<TJob>(Action<JobSettings> config)
            where TJob : IJob {
            var settings = new JobSettings();
            config(settings);
            process.AddScheduledJob<TJob>(settings);
            return this;
        }

        public JobSchedulingProcessFluent ScheduleRecurrentJob<TJob>(Action<RecurrentJobSettings> config)
            where TJob : IJob
        {
            var settings = new RecurrentJobSettings();
            config(settings);
            process.AddRecurrentJob<TJob>(settings);
            return this;
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) {
            return base.Equals(obj);
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() {
            return base.GetHashCode();
        }

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override string ToString() {
            return base.ToString();
        }

    }
}
